#include <iostream>
#include <cmath>
#include "DocumentVector.h"

using namespace std;

#ifdef TEST
int main (int argc, char const* argv[])
{
	// test DVReference

	DocumentVector dv (10);
	assert (dv[0] == 0);
	assert (++dv[0] == 1);
	assert (++dv[0] == 2);
	assert (dv[0] == 2);
	
	assert(dv[100] == 0);
	
	assert (dv[1] == 0);
	assert (dv[1]++ == 0);
	assert (dv[1]++ == 1);
	assert (dv[1] == 2);

	// test add_word_index	
	DocumentVector dvtest (50);
	dvtest[10]++;
	assert(dvtest[10] == 1);
	assert(dvtest.get_num_words() == 1);
	assert(dvtest.get_max_word_index() == 10);
	assert(dvtest.get_min_word_index() == 10);
	
	dvtest[10]++;
	assert(dvtest[10] == 2);
	assert(dvtest.get_num_words() == 1);
	
	dvtest[1]++;
	assert(dvtest.get_num_words() == 2);
	assert(dvtest.get_max_word_index() == 10);
	assert(dvtest.get_min_word_index() == 1);
	
	dvtest[20]++;
	assert(dvtest.get_max_word_index() == 20);
	assert(dvtest.get_min_word_index() == 1);
	
	return 0;
}
#endif
